home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS Vuser Deluxe 2003 October
/
DOS Vuser Deluxe 2003 Oct - Disc 1.iso
/
SKIN
/
The_Unit.wmz
/
unit.js
< prev
next >
Wrap
Text File
|
2001-09-04
|
6KB
|
224 lines
/*
now filled with 11% more functionality =)
threw in the.. uhmm.. bug fixes that MS found
*/
var showeqisOpen = false;
var theviddrawerisOpen = false;
var starStatus = 0;
var g_fExpectingSizeChange = false;
var g_fUserHasSized = false;
function onPlayStateChange() {
vidIsPlaying = (player.OpenState == osMediaOpen) && (player.currentMedia.ImageSourceWidth>0);
vidIsPlaying ? openVidWindow() : noshowVideo();
if (!player.controls.isAvailable("Stop")) {
noshowGears();
}
}
function openVidWindow() {
theme.openview( 'videoUnit' );
gearStatusOff();
}
function noshowVideo() {
vidIsPlaying = false;
gears.visible = true;
starStatus = 3;
}
function noshowGears() {
gearStatusOff();
}
function OnLoadVideo()
{
SnapToVideo();
}
// makes sure that the video stretches along with your resizing == this could be
// done within the <video/> tags...
function AllowResizeVideo()
{
mediacenter.videoStretchToFit=true;
mediacenter.videoShrinkToFit=true;
return;
}
// zooms your video window onClick
function ZoomVideo()
{
g_fUserHasSized = true;
mediacenter.videoStretchToFit = false;
mediacenter.videoShrinkToFit = false;
if( mediacenter.videoZoom < 51 )
{
mediacenter.videoZoom = 100;
}
else if( mediacenter.videoZoom < 101 )
{
mediacenter.videoZoom = 200;
}
else
{
mediacenter.videoZoom = 50;
}
SnapToVideo();
}
// resizes the window to the video width & height
function SnapToVideo()
{
if( (!g_fUserHasSized && mediacenter.videoStretchToFit) || !mediacenter.videoStretchToFit)
{
var zoom = mediacenter.videoStretchToFit ? 100 : mediacenter.videoZoom;
var x = (player.currentMedia.imageSourceWidth * (zoom / 100.0));
var y = (player.currentMedia.imageSourceHeight * (zoom / 100.0));
g_fExpectingSizeChange = true;
view.width = x + 12;
view.height = y + 19;
g_fExpectingSizeChange = false;
}
else
{
view.height= player.currentMedia.imageSourceHeight + 44;
view.width= player.currentMedia.imageSourceWidth + 110;
}
vidinfo.value = "Zoom: " + mediacenter.videoZoom + "%";
}
function OnCloseVideo()
{
video.close();
}
// end caption
// video settings drawer
function showsettings() {
if(theviddrawerisOpen){
vid_settings.moveTo(view.width-150,view.height-200,500);
theviddrawerisOpen = false;
vidsettings.upToolTip = "Show Video Settings";
} else {
vid_settings.moveTo(view.width-150,view.height-101,500);
theviddrawerisOpen = true;
vidsettings.upToolTip = "Hide Video Settings";
}
}
// eq stuff
function showeq() {
if (showeqisOpen) {
returnLittleButtons();
eqlayer.visible = false;
showeqisOpen = false;
emoneebanner.visible = true;
progressbarBack.visible = true;
starStatus = 0;
eqbutton.upToolTip = "Show Equalizer Settings";
} else {
eqlayer.visible = true;
emoneebanner.visible = false;
showeqisOpen = true;
visnext.visible = false;
visprev.visible = false;
eqnext.visible = true;
eqprev.visible = true;
progressbarBack.visible = false;
metadata.visible = true;
timeback.visible = true;
gears.visible = false;
visback.visible = false;
visBig.visible = false;
starStatus = 3;
eqbutton.upToolTip = "Hide Equalizer Settings";
}
}
// hide them when gears are playing or when bigVis is playing
function shutOffLittleButtons() {
visnext.visible = false;
visprev.visible = false;
randomb.visible = false;
repeatb.visible = false;
}
// return them to normal
function returnLittleButtons() {
visnext.visible = true;
visprev.visible = true;
randomb.visible = true;
repeatb.visible = true;
eqnext.visible = false;
eqprev.visible = false;
}
function toggleStarfish() {
starStatus++
switch (starStatus) {
case 1:
gears.visible = false;
visback.visible = true;
visBig.visible = false;
metadata.visible = true;
timeback.visible = true;
progressbarBack.visible = true;
emoneebanner.visible = false;
returnLittleButtons();
eqlayer.visible = false;
showeqisOpen = false;
infobutton.upToolTip = "Show Big Vis Effects"
break;
case 2:
gears.visible = false;
visback.visible = false;
visBig.visible = true;
metadata.visible = false;
timeback.visible = false;
progressbarBack.visible = false;
emoneebanner.visible = false;
eqlayer.visible = false;
showeqisOpen = false;
shutOffLittleButtons();
infobutton.upToolTip = "Show Gears Vis Effect"
break;
case 3:
gears.visible = true;
visback.visible = false;
visBig.visible = false;
metadata.visible = false;
timeback.visible = false;
progressbarBack.visible = false;
emoneebanner.visible = false;
eqlayer.visible = false;
showeqisOpen = false;
shutOffLittleButtons();
infobutton.upToolTip = "Shut off Gears Vis Effect"
break;
case 4:
gearStatusOff();
break;
}
}
function gearStatusOff() {
gears.visible = false;
visback.visible = false;
visBig.visible = false;
metadata.visible = true;
timeback.visible = true;
progressbarBack.visible = true;
eqlayer.visible = false;
showeqisOpen = false;
emoneebanner.visible = true;
returnLittleButtons();
infobutton.upToolTip = "Select Visual Effects"
starStatus = 0;
}